<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../../vendor/videojs/css/video-js.min.css">
    <style>
        html, body {
            overflow: hidden;
            padding: 0;
            margin: 0;
        }

        .container {
            width: 100%;
            height: 0;
            padding-top: 56.25%;
            position: relative;
        }

        #video {
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
        }

        button {
            outline: none;
        }
    </style>
</head>
<body>
<div class="container">
    <video id="video" class="video-js vjs-default-skin vjs-big-play-centered" controls
           controlsList="nodownload"></video>
</div>
<script type="text/javascript" src="../../vendor/base64/base64.min.js"></script>
<script type="text/javascript" src="../../vendor/videojs/js/video.min.js"></script>
<script type="text/javascript">
    var params = JSON.parse(Base64.decode(window.location.hash.substring(1)));
    var snapshot = '?x-oss-process=video/snapshot,t_1,f_jpg,w_0,h_0,m_fast';
    videojs('video', options = {
        controls: 'control',
        preload: 'auto',
        poster: params.source + snapshot,
        controlBar: {
            children: [
                {name: 'playToggle'},
                {name: 'progressControl'},
                {name: 'currentTimeDisplay'},
                {name: 'timeDivider'},
                {name: 'durationDisplay'},
                {name: 'volumePanel', inline: false},
                {name: 'fullscreenToggle'},
            ]
        }
    }, function () {
        document.querySelector('#video').setAttribute('style', 'display:block');
    });
    videojs('video').ready(function () {
        var myPlayer = this;
        var type = params.source.substring(params.source.lastIndexOf('.') + 1);
        type = type.length > 0 ? type : 'mp4';
        myPlayer.src({type: 'video/' + type, src: params.source});
    });
</script>
</body>
</html>